import random


class GetData:
    # 随机生成 3位英文名字
    def member_name(self):
        name_list = "qwertyuiopasddfghjklzxcvbnm"
        name = ""
        for i in range(3):
            a = random.randint(0, 26)
            name += name_list[a]
        return name

    # 随机生成 以1开头的11位手机号
    def member_phone_number(self):
        phone_number = "1"
        for i in range(10):
            a = random.randint(0, 9)
            phone_number += f'{a}'
        return phone_number

    # 随机生成 10位数的qq邮箱
    def qq_mail(self):
        qq_mail = ""
        for i in range(10):
            a = random.randint(0, 9)
            qq_mail += f'{a}'
        qq_mail += "@qq.com"
        return qq_mail

    # 随机生成 10位数的账号
    def account(self):
        account = ""
        for i in range(10):
            a = random.randint(0, 9)
            account += f'{a}'
        return account

    # name名字 account账号 alias别名 gender性别
    # enterprise_mailbox企业邮箱 select_phone选择手机号 phone_number手机号 telephone座机 mail邮箱 address地址
    # post职务 department_head部门负责人 direct_supervisor直属上级 external_duties对外职务
    # op操作(快速or完整) invite邀请 img_name图片名称 ignore_fail忽略报错
    def element_to_dict(self, op, name=None, account=None, alias=None, gender=None, enterprise_mailbox=None, select_phone=None, phone_number=None, telephone=None, mail=None, address=None, post=None, department_head=None, direct_supervisor=None, external_duties=None, invite=None, img_name=None, ignore_fail=None):
        dict1 = {"op": op, "name": name, "account": account, "alias": alias, "gender": gender,
                 "enterprise_mailbox": enterprise_mailbox, "select_phone": select_phone, "phone_number": phone_number,
                 "telephone": telephone, "mail": mail, "address": address, "post": post,
                 "department_head": department_head, "direct_supervisor": direct_supervisor,
                 "external_duties": external_duties, "invite": invite, "img_name": img_name, "ignore_fail": ignore_fail}
        return dict1

    # 添加字典到列表里
    def list_add_dict(self, *dict1):
        list1 = []
        for item in dict1:
            list1.append(item)
        return list1
